<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            margin: 10px auto;
            text-align: center;
        }
        input{
            margin: 10px;
        }
        button{
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div>
        <input type="text" name="mission" value="北京市">
        <input type="text" name="mission" value="朝阳区">
        <br>
        <button id="transFun" onclick="f1()">传参</button>
    </div>
</body>
</html> 


<script>
    function f1(){
        var line = document.getElementsByName("mission")
        for(var i=0;i<line.length;i++){
            alert(line[i].value)
        }
    }
</script>